package com.jarveis.frame.io;

import java.io.IOException;

/**
 * @desc 网络传输
 * @author Administrator
 * @date 2015-08-27
 */
public interface NetTransfer {

	/**
	 * 连接
	 * 
	 * @return
	 * @throws IOException
	 */
	public boolean connect() throws Exception;

	/**
	 * 断开
	 * 
	 * @return
	 * @throws IOException
	 */
	public boolean disconnect() throws Exception;

	/**
	 * 创建目录
	 * 
	 * @param remote
	 * @return
	 * @throws Exception
	 */
	public boolean CreateDirecroty(String remote) throws Exception;

	/**
	 * 上传文件
	 * 
	 * @param local
	 * @param remote
	 * @return
	 * @throws Exception
	 */
	public boolean upload(String local, String remote) throws Exception;

	/**
	 * 上传文件
	 * 
	 * @param remote
	 * @param byteArr
	 * @throws Exception
	 */
	public boolean upload(byte[] byteArr, String remote) throws Exception;

	/**
	 * 下载文件
	 * 
	 * @param remote
	 * @param local
	 * @return
	 * @throws Exception
	 */
	public boolean download(String remote, String local) throws Exception;
	
	/**
	 * 读取远程文件
	 * 
	 * @param remote
	 * @return
	 * @throws Exception
	 */
	public byte[] download(String remote) throws Exception;

	/**
	 * 下载文件
	 * 
	 * @param remote
	 * @return
	 * @throws Exception
	 */
	public boolean remove(String remote) throws Exception;

}
